package com.yxinsur.imc.business.enums;

import com.yxinsur.imc.common.utils.StringUtils;
import lombok.Getter;

/**
 * 计算维度  全部 产品
 */
@Getter
public enum PersistencyDimesionEnum {

    ALL("全部"),
    RISK("产品");


    private String code;
    private PersistencyDimesionEnum(String code){
        this.code=code;
    }

    public static String getCodeByDimesion(String method) {
        String keyValue = null;
        if (StringUtils.isNotBlank(method)) {
            for (PersistencyDimesionEnum c : PersistencyDimesionEnum.values()) {
                if (c.name().contains(method)) {
                    keyValue = c.getCode();
                    break;
                }
            }
        }
        return keyValue;
    }
}
